home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIGamesS-T.lzh
/
SpaceHarrier.lha
/
SpaceHarrierHD
/
Install-SpaceHarrier
next >
Wrap
Text File
|
2002-02-25
|
5KB
|
219 lines
;****************************
(set #sub-dir "") ;sub directory containing data files
(set #readme-file "ReadMe") ;name of readme file
(set #highs-file "SpaceHarrier.highs") ;name of high scores file
(set #cleanup "") ;files to delete after install
(set #last-file "Disk.1") ;last file the imager should create
;****************************
;----------------------------
; checks if given program is installed, if not abort install
; #program - to check
(procedure P_ChkRun
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
("")
(abort
(cat
"You must install \"" #program "\" first!\n"
"It must be accessible via the path.\n"
"You can find it in the WHDLoad package."
)
)
)
)
;****************************
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
(set #program "WHDLoad")
(P_ChkRun)
(set #program "RawDIC")
(P_ChkRun)
(if
(= @user-level 2)
(
(set #CI_drive
(askchoice
(prompt "Select source drive for diskimages")
(default 0)
(choices "DF0:" "DF1:" "DF2:" "DF3:")
(help @askchoice-help)
)
)
(select #CI_drive
(set #CI_drive "DF0:")
(set #CI_drive "DF1:")
(set #CI_drive "DF2:")
(set #CI_drive "DF3:")
)
(set #ignore " IGNOREERRORS")
)
(set #CI_drive "DF0:")
(set #ignore "")
)
(if
(getenv "WHDLInstPath")
(set @default-dest (getenv "WHDLInstPath"))
)
(set #dest
(askdir
(prompt
(cat
"Where should \"" @app-name "\" be installed?\n"
"A drawer \"" @app-name "\" will be automatically created."
)
)
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
(set #dest (tackon #dest @app-name))
(if
(exists #dest)
(
(set #choice
(askbool
(prompt
(cat
"\nDirectory \"" #dest "\" already exists.\n"
"Should it be deleted?"
)
)
(default 1)
(choices "Delete" "Skip")
(help @askbool-help)
)
)
(if
(= #choice 1)
(run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
)
)
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(copyfiles
(help @copyfiles-help)
(source ("%s.Slave" @app-name))
(dest #dest)
)
(if (exists ("%s.coloricon" @app-name)) ((set #icon 3)(set #icnt (+ 1 #icnt))(set #icon-col "OS3.5 Icon")) (set #icon-col ""))
(if (exists ("%s.newicon" @app-name)) ((set #icon 2)(set #icnt (+ 1 #icnt))(set #icon-new "NewIcon")) (set #icon-new ""))
(if (exists ("%s.romicon" @app-name)) ((set #icon 1)(set #icnt (+ 1 #icnt))(set #icon-rom "RomIcon")) (set #icon-rom ""))
(if (exists ("%s.inf" @app-name)) ((set #icon 0)(set #icnt (+ 1 #icnt))(set #icon-nor "Normal")) (set #icon-nor ""))
(if
(> #icnt 1)
(set #icon
(askchoice
(prompt "\nWhich icon would you like to install?\n")
(choices #icon-nor #icon-rom #icon-new #icon-col)
(default #icon)
(help @askchoice-help)
)
)
)
(select #icon
(set #icon "inf")
(set #icon "romicon")
(set #icon "newicon")
(set #icon "coloricon")
)
(copyfiles
(help @copyfiles-help)
(source ("%s.%s" @app-name #icon))
(newname ("%s.info" @app-name))
(dest #dest)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(if
(exists ("%s.info" #readme-file))
(
(copyfiles
(help @copyfiles-help)
(source ("%s.info" #readme-file))
(dest #dest)
)
(tooltype
(dest (tackon #dest #readme-file))
(noposition)
)
)
)
(if
(= #sub-dir "")
("")
(
(set #dest (tackon #dest #sub-dir))
(makedir #dest
(help @makedir-help)
)
)
)
(if
(exists #highs-file)
(copyfiles
(help @copyfiles-help)
(source #highs-file)
(dest #dest)
)
)
(copyfiles
(help @copyfiles-help)
(source ("%s.islave" @app-name))
(dest #dest)
)
(working)
(run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
(if
(exists (tackon #dest #last-file))
("")
(abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
)
(copyfiles
(help @copyfiles-help)
(source ("%sBOOT" #CI_drive @app-name))
(dest #dest)
)
;----------------------------
(run ("Delete %s ALL QUIET FORCE" #cleanup)) ;delete temporary files
(if
(= 0 (run "cd SYS:\nWhich opendrawer"))
(run ("opendrawer \"%s\"" #dest))
)
(exit)